<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js斐波那契数列获取第25位</title>
</head>
<body>


<script>
    //1,1,2,3,5,8,13,21...
    //从第三位开始，数字等于前两位数字的和
    function fbnq(n){
        if(n ==1 || n==2){
            return 1;
        }else {
            return fbnq(n-1)+fbnq(n-2);
        }
    }

    console.log(fbnq(25));
</script>
</body>
</html>